/* ***********************
 * Version: MPL 1.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is SiteTagline.js module.
 *
 * The Initial Developer of the Original Code is Rob Gerns.
 *
 * Portions created by the Initial Developer are Copyright (C) 2010
 * the Initial Developer. All Rights Reserved.
 *
 **************************/

/*************************************************
* Function Name(s): SiteTagline; writeTagline
*
* Purpose:
* Check to see if there is a tagline defined in the 
* 'brief' section of the Oister file.  If there is
* create the necessary div and write the tagline  
* inside the div.
**************************************************/

function siteTagline(xmlDocument){	
  
 //Check to see if a tagline was included
 var checkTagline = xmlDocument.getElementsByTagName("tagline").length;

 //If so, get it's value, otherwise make it blank
 if(checkTagline > 0 && checkTagline !=undefined) {
 
  var tagline = xmlDocument.getElementsByTagName("tagline").item(0).firstChild.data;
    
 }
 else tagline = "";
	
 //Call the writeTagline function to create the appropriate div
 writeTagline(tagline);
	
}


function writeTagline(tline){

 //If there is a tagline, create the div that contains the tagline and write it in
	if(tline != undefined && tline != "") {
  
   divTagline = document.createElement("div");
   taglineId = divTagline.id = "tagline";
   divTagline.className = "tagline";
   document.getElementById('begin').appendChild(divTagline);
   document.getElementById(taglineId).innerHTML = tline;
   
  }

}
